package a04demo4;

import java.io.File;

public class Test {
    public static void main(String[] args) {
        //D:\vscode\JavaScript\e
        File f = new File("D:\\vscode\\JavaScript\\e");
        delete(f);
    }

    public static void delete(File src) {
        File[] files = src.listFiles();
        if (files != null) {
            for (File file : files) {
                if (file.isFile()) {
                    file.delete();
                } else {
                    delete(file);
                }
            }
            src.delete();
        }
    }
}
